// tag html function
window.Html = window.Html || {};
/**
 * 单选
 */
Html.onCheckbox = function(args) {
	var hid = args.hiddenId, $b = $(args.ckb);
	var hf = $("#" + hid + "[groupId='" + $b.attr("groupId") + "']")[0];
	if ($b[0].checked) {
		hf.value = $b.attr("checkValue");
	} else {
		hf.value = $b.attr("unCheckValue");
	}
}
/**
 * 多选
 */
Html.onDuplicateCheckbox = function(ckb) {
	var $b = $(ckb), hid = $b.attr("hiddenId"), groupId = $b.attr("groupId");
	var hf = $("#" + hid + "[groupId='" + groupId + "']")[0];
	var grougCkbs = $(":checkbox[groupId='" + groupId + "']");
	var values = [];
	grougCkbs.each(function(i, c) {
		if (c.checked) {
			values.push(c.value);
		}
	});
	hf.value = values.join(",");
}